<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
  </head>
  <body>
			<div class="widget-box">
       <div class="widget-title"> <span class="icon"> <i class="icon-align-justify"></i> </span>
         <h5>导入用户信息</h5>
       </div>
       <div class="widget-content nopadding">
         <s:form action="/xtgl/assessuser/saveAssessUserAdd.html" method="post" enctype="multipart/form-data"
         	cssClass="form-horizontal" id="assessUserForm">
	        	<div class="alert alert-info">
	             <button class="close" data-dismiss="alert">×</button>
	             <strong>温馨提示：</strong> <br/>
	             1.请严格按照模板导入用户信息。（导入时若检测未按照模板导入或修改了模板格式，则会不成功。）<br/>
	             2.导入的被评估者的用户关系将被重置、更新，其关系以[被评估者]为单位进行绑定。<br/>
	             3.导入的用户若在本系统中已存在，更新其[单位]、[部门]、[职位]。<br/>
	             4.导入新单位，自动增加到系统。<br/>
	             5.导入新用户，自动增加到系统。<br/>
	             6.导入新用户的相互关系，自动增加到系统。	             
	          </div>
           <div class="control-group">
             <label class="control-label"><span style="color:red;">*</span>导入文件</label>
             <div class="controls">
                <input type="file" name="excelFile" id="excelFile"/>
             </div>
           </div>
           <div class="modal-footer">
           	<div style="float:left;">"<span style="color:red;">*</span>"为必填项。</div>
           	<a href="#" class="btn" data-dismiss="modal" onclick="closeDialog();" >关闭</a>
           	<a href="#" id="add-event-submit" class="btn btn-primary" onclick="importUser();" >导入</a>
           </div>
         </s:form>
       </div>
		</div>
  </body>
  	<link rel="stylesheet" href="<%=request.getContextPath() %>/css/bootstrap.min.css" />
		<link rel="stylesheet" href="<%=request.getContextPath() %>/css/bootstrap-responsive.min.css" />
		<link rel="stylesheet" href="<%=request.getContextPath() %>/css/matrix-style.css" />
		<link rel="stylesheet" href="<%=request.getContextPath() %>/css/matrix-media.css" />
		<link rel="stylesheet" href="<%=request.getContextPath() %>/css/uniform.css" />
		<script  type="text/javascript" src="<%=request.getContextPath() %>/js/jquery.min.js"></script> 
		<script  type="text/javascript" src="<%=request.getContextPath() %>/js/jquery.uniform.js"></script> 
		
		<script type="text/javascript" src="<%=request.getContextPath() %>/js/jquery/plugin/jquery.form.min.js"></script>
  	<script type="text/javascript" src="<%=request.getContextPath() %>/js/lhgdialog/dialogUtil.js"></script>
		<script type="text/javascript" src="<%=request.getContextPath() %>/js/lhgdialog/lhgdialog.min.js?skin=iblue"></script>
		<link href="<%=request.getContextPath() %>/font-awesome/css/font-awesome.css" rel="stylesheet" />	
		<script type="text/javascript">

		jQuery(function(){
			
			jQuery('input[type=file]').uniform();
			
		});
		function importUser(){
				var file = jQuery("#excelFile").val();
				//return false;
				var extname = "";
				if(file === ''){
					alert("请先选择上传的文件!");
					return false;
				}else{

            var lc = file.toLowerCase();  
            var arr = lc.split(".");  
            extname = arr[arr.length-1];  
            if(extname != "xls" && extname != "xlsx"){  
                 alert("请选择excel格式文件！");  
                 return false;
            }
				}
				jQuery("#assessUserForm").ajaxSubmit({
					url:"<%=request.getContextPath() %>/xtgl/assessuser/importAssessUser.html?fileContentType="+extname,
					type:"post",
				  dataType: 'json',//返回数据类型
					success:function(data){
						alert(data,function(){
							refershParent();
						});
					}
				});
		}
		</script>
</html>
